<html>
<head><meta charset="utf-8"><title>debuginfo-level · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html">debuginfo-level</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167570274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570274">(Jun 07 2019 at 12:04)</a>:</h4>
<p>I saw a while ago some changes to the way the configuration now works</p>



<a name="167570307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570307">(Jun 07 2019 at 12:05)</a>:</h4>
<p><a href="https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html">https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html</a> suggest to set debuginfo-level to 2</p>



<a name="167570324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570324">(Jun 07 2019 at 12:05)</a>:</h4>
<p>I was wondering if shouldn't that recommend to set <code>debug = true</code></p>



<a name="167570392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570392">(Jun 07 2019 at 12:06)</a>:</h4>
<p>the effect should be the same</p>



<a name="167570452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570452">(Jun 07 2019 at 12:07)</a>:</h4>
<p>in particular this was made on purpose <code>#debuginfo-level = if debug { 2 } else { 0 }</code></p>



<a name="167570465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570465">(Jun 07 2019 at 12:07)</a>:</h4>
<p>so by doing <code>debug = true</code> we play nice with the file and not go against</p>



<a name="167570474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570474">(Jun 07 2019 at 12:07)</a>:</h4>
<p>/cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="167570476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167570476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167570476">(Jun 07 2019 at 12:07)</a>:</h4>
<p>anyway, probably just a silly bikesheed from my side</p>



<a name="167595739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167595739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167595739">(Jun 07 2019 at 17:25)</a>:</h4>
<p>/cc <span class="user-mention" data-user-id="198054">@mark-i-m</span></p>



<a name="167611517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611517">(Jun 07 2019 at 20:31)</a>:</h4>
<p>hmmm... yeah that seems reasonable</p>



<a name="167611736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611736">(Jun 07 2019 at 20:34)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-guide/pull/332" target="_blank" title="https://github.com/rust-lang/rustc-guide/pull/332">https://github.com/rust-lang/rustc-guide/pull/332</a></p>



<a name="167611739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611739">(Jun 07 2019 at 20:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ^^</p>



<a name="167611870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611870">(Jun 07 2019 at 20:36)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="167611882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611882">(Jun 07 2019 at 20:36)</a>:</h4>
<p>as soon as check are ok, I can merge it :)</p>



<a name="167611996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167611996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167611996">(Jun 07 2019 at 20:38)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> was looking for the suggestion here <a href="https://rust-lang.github.io/rustc-guide/profiling/with_perf.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/profiling/with_perf.html">https://rust-lang.github.io/rustc-guide/profiling/with_perf.html</a></p>



<a name="167612042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612042">(Jun 07 2019 at 20:39)</a>:</h4>
<p>but yeah, I guess you want <code>1</code> there and not <code>2</code> as it is when you're debugging</p>



<a name="167612205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612205">(Jun 07 2019 at 20:41)</a>:</h4>
<p>also <code>src/compiler-debugging.md</code></p>



<a name="167612217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612217">(Jun 07 2019 at 20:41)</a>:</h4>
<div class="codehilite"><pre><span></span>If you want line numbers for the stack trace, you can enable
`debuginfo-level = 1` or `debuginfo-level = 2` in your config.toml and rebuild the
compiler. Then the backtrace will look like this:
</pre></div>



<a name="167612304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612304">(Jun 07 2019 at 20:42)</a>:</h4>
<p><code>src/codegen/debugging.md</code></p>



<a name="167612314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612314">(Jun 07 2019 at 20:42)</a>:</h4>
<div class="codehilite"><pre><span></span>`cargo llvm-ir [options] path` spits out the LLVM IR for a particular function
at `path`. (`cargo install cargo-asm` installs `cargo asm` and `cargo
llvm-ir`). `--build-type=debug` emits code for debug builds. There are also
other useful options. Also, debug info in LLVM IR can clutter the output a lot:
`RUSTFLAGS=&quot;-C debuginfo=0&quot;` is really useful.
</pre></div>



<a name="167612321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612321">(Jun 07 2019 at 20:42)</a>:</h4>
<p>maybe here is better to say <code>-C debug=false</code></p>



<a name="167612348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612348">(Jun 07 2019 at 20:43)</a>:</h4>
<p>Ah, I see</p>



<a name="167612374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612374">(Jun 07 2019 at 20:43)</a>:</h4>
<p>In the case of <code>perf</code>, I think you want to have minimal debuginfo to avoid overhead skewing the results</p>



<a name="167612397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612397">(Jun 07 2019 at 20:44)</a>:</h4>
<p>yep, agreed</p>



<a name="167612439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612439">(Jun 07 2019 at 20:44)</a>:</h4>
<p>(thought TBH I don't know if that's a problem in practice)</p>



<a name="167612447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612447">(Jun 07 2019 at 20:44)</a>:</h4>
<p>I agree that the others should suggest debug=true/false, though</p>



<a name="167612452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167612452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167612452">(Jun 07 2019 at 20:44)</a>:</h4>
<p>I will update the PR</p>



<a name="167613212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167613212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167613212">(Jun 07 2019 at 20:57)</a>:</h4>
<blockquote>
<p>maybe here is better to say <code>-C debug=false</code></p>
</blockquote>
<p>Actually this is a compiler flag, not a config option...</p>



<a name="167613218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167613218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167613218">(Jun 07 2019 at 20:57)</a>:</h4>
<p>I opened a new PR because github was being weird</p>



<a name="167613272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167613272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167613272">(Jun 07 2019 at 20:58)</a>:</h4>
<p>should include the previous change and the change to src/compiler-debugging.md that you pointed out</p>



<a name="167613302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167613302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167613302">(Jun 07 2019 at 20:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> <a href="https://github.com/rust-lang/rustc-guide/pull/333" target="_blank" title="https://github.com/rust-lang/rustc-guide/pull/333">https://github.com/rust-lang/rustc-guide/pull/333</a></p>



<a name="167613317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/debuginfo-level/near/167613317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/debuginfo-level.html#167613317">(Jun 07 2019 at 20:59)</a>:</h4>
<blockquote>
<blockquote>
<p>maybe here is better to say <code>-C debug=false</code></p>
</blockquote>
<p>Actually this is a compiler flag, not a config option...</p>
</blockquote>
<p>right</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>